
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

char text[20000];
char out[20000];
char match[6][20]={"sith","smth","smih","Sith","Smth","Smih"};

int notLetter(char ch)
{
    return !((ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z'));
}

void modify(char *text, char *out)
{
    int find,i,j;
    int size=strlen(text);
    for(i=0; i<size-4; i++)
    {
/***************  Wrong  *******************
        find=0;
        for(j=0;j<6;j++)
            if(text[i]==match[j][0]&&
               text[i+1]==match[j][1]&&
               text[i+2]==match[j][2]&&
               text[i+3]==match[j][3]&&
               notLetter(match[j][4])) find=1;
        *out++=text[i];
********************************************/
find=0;
        for(j=0;j<6;j++)
            if(text[i]==match[j][0]&&
               text[i+1]==match[j][1]&&
               text[i+2]==match[j][2]&&
               text[i+3]==match[j][3]&&
               notLetter(text[i+4])) find=1;
		if(find){
			*out++='S';
			*out++='m';
			*out++='i';
			*out++='t';
			*out++='h';
			i=i+3;
		}else{
			*out++= text[i];
		}
    }
    if(!find)
    {
        *out++=text[i];*out++=text[i+1];*out++=text[i+2];*out++=text[i+3];*out++=0;
    }
}

int main()
{
    int size=0;
    while((text[size]=getchar())!='#') size++;
    text[size]=0;
    modify(text, out);
    printf("%s",out);
    return 0;
}
